/**
 * 作者: wgx
 * 日期: 2024-10-14 16:33:42
 * 备注: 势力
 */
package com.motu.monstercity.server.game.userdata;

import com.motu.monstercity.protocol.Common.PBUserPower;
import com.motu.vertx.module.utility.model.BaseModel;
import com.motu.vertx.module.utility.model.Model;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;

public class UserPowerModel extends BaseModel implements Model {
    public static final String LISTKEY = "";
    public static final int REDIS_EXPIRE_TIME = 0;// redis过期时间
    public static final int UPDATE_DB_TYPE = UPDATE_DB_TYPE_QUEUE;// 数据入库类型 队列入库
    public static final boolean ORDER_LIST = false;// 是否需要额外的有序列表

    protected long id; // 用户ID
    protected long power; // 总战力 (包括了称号加成，联盟地标加成，雷达固定值加成等)
    protected long maxPower; // 历史最高战力
    protected long earn; // 总收益 (（建筑收益+后代收益）*（1+特权卡收益加成+永久收益加成+临时收益加成）)
    protected long maxEarn; // 总收益的历史最高值
    protected int pricardAdd; // 收益特权卡加成 (1W倍客户端同步城市收益,1分钟请求一次,更新，加成在子嗣+建筑)
    protected long buildEarn; // 建筑的总收益
    protected long childEarn; // 子嗣的总收益
    protected int powerAddTitleCv; // 称号模块战力加固定值 (对所有干员)
    protected int powerAddTitlePer; // 称号模块战力加成百分比 (1W倍客户端同步城市收益,1分钟请求一次,更新，百分比，2000表示每个干员加成20%，对所有干员)
    protected long powerAddWorldCv; // 大世界模块战力加成固定值 (固定值，对所有干员，雷达)
    protected String powerAddUnionPer = ""; // 联盟模块战力加成百分比 ([100,200...]第一个表示所有干员，第二个表示性格1的干员，类推，地标建筑)
    protected String powerAddUnionCv = ""; // 联盟模块战力加成固定值 (对对应性格干员加成固定值)
    protected String earnAddSecrPer = ""; // 秘书加成百分比1W倍 ([100,200...]第一个表示所有干员，第二个表示性格1的建筑，类推，地标建筑，加成在建筑上,)
    protected int earnAddBankPer; // 银行的加成百分比,1W倍 (加成在建筑上)
    protected String earnAddDecoratePer = ""; // 装饰类建筑加成百分比1W倍 ([100,200...]第一个表示所有干员，第二个表示性格1的建筑，类推，地标建筑，加成在建筑上,)
    protected String earnAddUnionPer = ""; // 联盟建筑加成百分比1W倍 ([100,200...]第一个表示所有干员，第二个表示性格1的建筑，类推，地标建筑，加成在建筑上)
    protected int earnAddCavePer; // 怪兽洞窟的加成百分比,1W倍 (加成在建筑)
    protected int earnAddMonsterPer; // 兽潮的加成百分比,1W倍 (可以负数，加成在（建筑+子嗣）)
    protected int earnAddTitlePer; // 称号对城市收益加成百分比 (1W倍客户端同步城市收益,1分钟请求一次,更新，百分比，2000表示每个干员加成20%，对所有干员)
    protected int weaponLevelMaxAdd; // 所有武器等级增加的上限
    protected String partnerId = ""; // 已经解锁的干员Id (方便计算用)
    protected String buildId = ""; // 已经建造的商业建筑的id (方便计算用)
    protected String earnAddFoodPer = ""; // 美食攻略加成百分比1W倍 ([100,200...]第一个表示所有干员，第二个表示性格1的建筑，类推，地标建筑，加成在建筑上,)
    protected String powerAddHaloPer = ""; // 光环技能对战力的加成 ([100,200...]第一个表示所有干员，第二个表示性格1的干员,对所有干员)

    public void reset() {
    }

    protected String getKey() {
        return "UserPower." + id;
    }

    protected String getListKey() {
        return null;
    }

    protected String getListItemKey() {
        return null;
    }

    public void doCreate() {
        setTableId();
        insert();
    }

    public void setTableId() {
        putId(incrTableId("user_power"));
    }

    public JsonObject insert() {
        return super.insert(getKey(), id, REDIS_EXPIRE_TIME, UPDATE_DB_TYPE, LISTKEY, getListKey(), getListItemKey(), ORDER_LIST);
    }

    public void delete() {
        super.delete(getKey(), id, UPDATE_DB_TYPE, id, LISTKEY, getListKey(), getListItemKey(), ORDER_LIST);
    }

    /**
     * 根据入库类型更新
     */
    public JsonObject update() {
        return super.update(getKey(), id, REDIS_EXPIRE_TIME, UPDATE_DB_TYPE, id, getAllObj(), LISTKEY, getListKey(), getListItemKey());
    }

    /**
     * 实时入队列
     */
    public JsonObject updateQueueNow() {
        return super.update(getKey(), id, REDIS_EXPIRE_TIME, UPDATE_DB_TYPE, 0, getAllObj(), LISTKEY, getListKey(), getListItemKey());
    }

    public JsonObject getAllObj(){
        JsonObject obj = new JsonObject();
        obj.put("id", id); // 用户ID
        obj.put("power", power); // 总战力 (包括了称号加成，联盟地标加成，雷达固定值加成等)
        obj.put("maxPower", maxPower); // 历史最高战力
        obj.put("earn", earn); // 总收益 (（建筑收益+后代收益）*（1+特权卡收益加成+永久收益加成+临时收益加成）)
        obj.put("maxEarn", maxEarn); // 总收益的历史最高值
        obj.put("pricardAdd", pricardAdd); // 收益特权卡加成 (1W倍客户端同步城市收益,1分钟请求一次,更新，加成在子嗣+建筑)
        obj.put("buildEarn", buildEarn); // 建筑的总收益
        obj.put("childEarn", childEarn); // 子嗣的总收益
        obj.put("powerAddTitleCv", powerAddTitleCv); // 称号模块战力加固定值 (对所有干员)
        obj.put("powerAddTitlePer", powerAddTitlePer); // 称号模块战力加成百分比 (1W倍客户端同步城市收益,1分钟请求一次,更新，百分比，2000表示每个干员加成20%，对所有干员)
        obj.put("powerAddWorldCv", powerAddWorldCv); // 大世界模块战力加成固定值 (固定值，对所有干员，雷达)
        obj.put("powerAddUnionPer", powerAddUnionPer); // 联盟模块战力加成百分比 ([100,200...]第一个表示所有干员，第二个表示性格1的干员，类推，地标建筑)
        obj.put("earnAddSecrPer", earnAddSecrPer); // 秘书加成百分比1W倍 ([100,200...]第一个表示所有干员，第二个表示性格1的建筑，类推，地标建筑，加成在建筑上,)
        obj.put("earnAddBankPer", earnAddBankPer); // 银行的加成百分比,1W倍 (加成在建筑上)
        obj.put("earnAddDecoratePer", earnAddDecoratePer); // 装饰类建筑加成百分比1W倍 ([100,200...]第一个表示所有干员，第二个表示性格1的建筑，类推，地标建筑，加成在建筑上,)
        obj.put("earnAddUnionPer", earnAddUnionPer); // 联盟建筑加成百分比1W倍 ([100,200...]第一个表示所有干员，第二个表示性格1的建筑，类推，地标建筑，加成在建筑上)
        obj.put("earnAddCavePer", earnAddCavePer); // 怪兽洞窟的加成百分比,1W倍 (加成在建筑)
        obj.put("earnAddMonsterPer", earnAddMonsterPer); // 兽潮的加成百分比,1W倍 (可以负数，加成在（建筑+子嗣）)
        obj.put("earnAddTitlePer", earnAddTitlePer); // 称号对城市收益加成百分比 (1W倍客户端同步城市收益,1分钟请求一次,更新，百分比，2000表示每个干员加成20%，对所有干员)
        obj.put("weaponLevelMaxAdd", weaponLevelMaxAdd); // 所有武器等级增加的上限
        obj.put("partnerId", partnerId); // 已经解锁的干员Id (方便计算用)
        obj.put("buildId", buildId); // 已经建造的商业建筑的id (方便计算用)
        obj.put("earnAddFoodPer", earnAddFoodPer); // 美食攻略加成百分比1W倍 ([100,200...]第一个表示所有干员，第二个表示性格1的建筑，类推，地标建筑，加成在建筑上,)
        obj.put("powerAddHaloPer", powerAddHaloPer); // 光环技能对战力的加成 ([100,200...]第一个表示所有干员，第二个表示性格1的干员,对所有干员)
        obj.put("powerAddUnionCv", powerAddUnionCv); // 联盟模块战力加成固定值 (对对应性格干员加成固定值)
        return obj;
    }

    public PBUserPower.Builder takeInitBuilder() {
        PBUserPower.Builder sb = PBUserPower.newBuilder();
        if (power != 0) {
            sb.setPower(power);
        }
        if (maxPower != 0) {
            sb.setMaxPower(maxPower);
        }
        if (earn != 0) {
            sb.setEarn(earn);
        }
        if (maxEarn != 0) {
            sb.setMaxEarn(maxEarn);
        }
        if (pricardAdd != 0) {
            sb.setPricardAdd(pricardAdd);
        }
        if (buildEarn != 0) {
            sb.setBuildEarn(buildEarn);
        }
        if (childEarn != 0) {
            sb.setChildEarn(childEarn);
        }
        if (powerAddTitleCv != 0) {
            sb.setPowerAddTitleCv(powerAddTitleCv);
        }
        if (powerAddTitlePer != 0) {
            sb.setPowerAddTitlePer(powerAddTitlePer);
        }
        if (powerAddWorldCv != 0) {
            sb.setPowerAddWorldCv(powerAddWorldCv);
        }
        if (this.powerAddUnionPer != null && this.powerAddUnionPer.length() > 0) {
            JsonArray list = new JsonArray(this.powerAddUnionPer);
            for(int i=0; i<list.size(); i++) {
                sb.addPowerAddUnionPer(list.getInteger(i));
            }
        }
        if (this.earnAddSecrPer != null && this.earnAddSecrPer.length() > 0) {
            JsonArray list = new JsonArray(this.earnAddSecrPer);
            for(int i=0; i<list.size(); i++) {
                sb.addEarnAddSecrPer(list.getInteger(i));
            }
        }
        if (earnAddBankPer != 0) {
            sb.setEarnAddBankPer(earnAddBankPer);
        }
        if (this.earnAddDecoratePer != null && this.earnAddDecoratePer.length() > 0) {
            JsonArray list = new JsonArray(this.earnAddDecoratePer);
            for(int i=0; i<list.size(); i++) {
                sb.addEarnAddDecoratePer(list.getInteger(i));
            }
        }
        if (this.earnAddUnionPer != null && this.earnAddUnionPer.length() > 0) {
            JsonArray list = new JsonArray(this.earnAddUnionPer);
            for(int i=0; i<list.size(); i++) {
                sb.addEarnAddUnionPer(list.getInteger(i));
            }
        }
        if (earnAddCavePer != 0) {
            sb.setEarnAddCavePer(earnAddCavePer);
        }
        if (earnAddMonsterPer != 0) {
            sb.setEarnAddMonsterPer(earnAddMonsterPer);
        }
        if (earnAddTitlePer != 0) {
            sb.setEarnAddTitlePer(earnAddTitlePer);
        }
        if (weaponLevelMaxAdd != 0) {
            sb.setWeaponLevelMaxAdd(weaponLevelMaxAdd);
        }
        if (this.earnAddFoodPer != null && this.earnAddFoodPer.length() > 0) {
            JsonArray list = new JsonArray(this.earnAddFoodPer);
            for(int i=0; i<list.size(); i++) {
                sb.addEarnAddFoodPer(list.getInteger(i));
            }
        }
        if (this.powerAddHaloPer != null && this.powerAddHaloPer.length() > 0) {
            JsonArray list = new JsonArray(this.powerAddHaloPer);
            for(int i=0; i<list.size(); i++) {
                sb.addPowerAddHaloPer(list.getInteger(i));
            }
        }
        if (this.powerAddUnionCv != null && this.powerAddUnionCv.length() > 0) {
            JsonArray list = new JsonArray(this.powerAddUnionCv);
            for(int i=0; i<list.size(); i++) {
                sb.addPowerAddUnionCv(list.getInteger(i));
            }
        }
        return sb;
    }

    public PBUserPower.Builder takeBuilder() {
        if (updateObj == null || updateObj.isEmpty()) {
            return takeInitBuilder();
        }
        PBUserPower.Builder sb = PBUserPower.newBuilder();
        if (isFieldUpdate("power")) {
            sb.setPower(power);
        }
        if (isFieldUpdate("maxPower")) {
            sb.setMaxPower(maxPower);
        }
        if (isFieldUpdate("earn")) {
            sb.setEarn(earn);
        }
        if (isFieldUpdate("maxEarn")) {
            sb.setMaxEarn(maxEarn);
        }
        if (isFieldUpdate("pricardAdd")) {
            sb.setPricardAdd(pricardAdd);
        }
        if (isFieldUpdate("buildEarn")) {
            sb.setBuildEarn(buildEarn);
        }
        if (isFieldUpdate("childEarn")) {
            sb.setChildEarn(childEarn);
        }
        if (isFieldUpdate("powerAddTitleCv")) {
            sb.setPowerAddTitleCv(powerAddTitleCv);
        }
        if (isFieldUpdate("powerAddTitlePer")) {
            sb.setPowerAddTitlePer(powerAddTitlePer);
        }
        if (isFieldUpdate("powerAddWorldCv")) {
            sb.setPowerAddWorldCv(powerAddWorldCv);
        }
        if (isFieldUpdate("powerAddUnionPer")) {
            if (this.powerAddUnionPer != null && this.powerAddUnionPer.length() > 0) {
                JsonArray list = new JsonArray(this.powerAddUnionPer);
                for(int i=0; i<list.size(); i++) {
                    sb.addPowerAddUnionPer(list.getInteger(i));
                }
                if (list.isEmpty()) {
                    sb.clearPowerAddUnionPer();
                }
            } else {
                sb.clearPowerAddUnionPer();
            }
        }
        if (isFieldUpdate("earnAddSecrPer")) {
            if (this.earnAddSecrPer != null && this.earnAddSecrPer.length() > 0) {
                JsonArray list = new JsonArray(this.earnAddSecrPer);
                for(int i=0; i<list.size(); i++) {
                    sb.addEarnAddSecrPer(list.getInteger(i));
                }
                if (list.isEmpty()) {
                    sb.clearEarnAddSecrPer();
                }
            } else {
                sb.clearEarnAddSecrPer();
            }
        }
        if (isFieldUpdate("earnAddBankPer")) {
            sb.setEarnAddBankPer(earnAddBankPer);
        }
        if (isFieldUpdate("earnAddDecoratePer")) {
            if (this.earnAddDecoratePer != null && this.earnAddDecoratePer.length() > 0) {
                JsonArray list = new JsonArray(this.earnAddDecoratePer);
                for(int i=0; i<list.size(); i++) {
                    sb.addEarnAddDecoratePer(list.getInteger(i));
                }
                if (list.isEmpty()) {
                    sb.clearEarnAddDecoratePer();
                }
            } else {
                sb.clearEarnAddDecoratePer();
            }
        }
        if (isFieldUpdate("earnAddUnionPer")) {
            if (this.earnAddUnionPer != null && this.earnAddUnionPer.length() > 0) {
                JsonArray list = new JsonArray(this.earnAddUnionPer);
                for(int i=0; i<list.size(); i++) {
                    sb.addEarnAddUnionPer(list.getInteger(i));
                }
                if (list.isEmpty()) {
                    sb.clearEarnAddUnionPer();
                }
            } else {
                sb.clearEarnAddUnionPer();
            }
        }
        if (isFieldUpdate("earnAddCavePer")) {
            sb.setEarnAddCavePer(earnAddCavePer);
        }
        if (isFieldUpdate("earnAddMonsterPer")) {
            sb.setEarnAddMonsterPer(earnAddMonsterPer);
        }
        if (isFieldUpdate("earnAddTitlePer")) {
            sb.setEarnAddTitlePer(earnAddTitlePer);
        }
        if (isFieldUpdate("weaponLevelMaxAdd")) {
            sb.setWeaponLevelMaxAdd(weaponLevelMaxAdd);
        }
        if (isFieldUpdate("earnAddFoodPer")) {
            if (this.earnAddFoodPer != null && this.earnAddFoodPer.length() > 0) {
                JsonArray list = new JsonArray(this.earnAddFoodPer);
                for(int i=0; i<list.size(); i++) {
                    sb.addEarnAddFoodPer(list.getInteger(i));
                }
                if (list.isEmpty()) {
                    sb.clearEarnAddFoodPer();
                }
            } else {
                sb.clearEarnAddFoodPer();
            }
        }
        if (isFieldUpdate("powerAddHaloPer")) {
            if (this.powerAddHaloPer != null && this.powerAddHaloPer.length() > 0) {
                JsonArray list = new JsonArray(this.powerAddHaloPer);
                for(int i=0; i<list.size(); i++) {
                    sb.addPowerAddHaloPer(list.getInteger(i));
                }
                if (list.isEmpty()) {
                    sb.clearPowerAddHaloPer();
                }
            } else {
                sb.clearPowerAddHaloPer();
            }
        }
        if (isFieldUpdate("powerAddUnionCv")) {
            if (this.powerAddUnionCv != null && this.powerAddUnionCv.length() > 0) {
                JsonArray list = new JsonArray(this.powerAddUnionCv);
                for(int i=0; i<list.size(); i++) {
                    sb.addPowerAddUnionCv(list.getInteger(i));
                }
                if (list.isEmpty()) {
                    sb.clearPowerAddUnionCv();
                }
            } else {
                sb.clearPowerAddUnionCv();
            }
        }
        return sb;
    }

    public long getId() {
        return id;
    }

    public void putId(long id) {
        if (this.id != id) {
            this.id = id;
            updateRedisHashField(getKey(), "id", this.id);
        }
    }

    public void addId(long value) {
        this.id += value;
        updateRedisHashField(getKey(), "id", this.id);
    }

    public long getPower() {
        return power;
    }

    public void putPower(long power) {
        if (this.power != power) {
            this.power = power;
            updateRedisHashField(getKey(), "power", this.power);
        }
    }

    public void addPower(long value) {
        this.power += value;
        updateRedisHashField(getKey(), "power", this.power);
    }

    public long getMaxPower() {
        return maxPower;
    }

    public void putMaxPower(long maxPower) {
        if (this.maxPower != maxPower) {
            this.maxPower = maxPower;
            updateRedisHashField(getKey(), "maxPower", this.maxPower);
        }
    }

    public void addMaxPower(long value) {
        this.maxPower += value;
        updateRedisHashField(getKey(), "maxPower", this.maxPower);
    }

    public long getEarn() {
        return earn;
    }

    public void putEarn(long earn) {
        if (this.earn != earn) {
            this.earn = earn;
            updateRedisHashField(getKey(), "earn", this.earn);
        }
    }

    public void addEarn(long value) {
        this.earn += value;
        updateRedisHashField(getKey(), "earn", this.earn);
    }

    public long getMaxEarn() {
        return maxEarn;
    }

    public void putMaxEarn(long maxEarn) {
        if (this.maxEarn != maxEarn) {
            this.maxEarn = maxEarn;
            updateRedisHashField(getKey(), "maxEarn", this.maxEarn);
        }
    }

    public void addMaxEarn(long value) {
        this.maxEarn += value;
        updateRedisHashField(getKey(), "maxEarn", this.maxEarn);
    }

    public int getPricardAdd() {
        return pricardAdd;
    }

    public void putPricardAdd(int pricardAdd) {
        if (this.pricardAdd != pricardAdd) {
            this.pricardAdd = pricardAdd;
            updateRedisHashField(getKey(), "pricardAdd", this.pricardAdd);
        }
    }

    public void addPricardAdd(int value) {
        this.pricardAdd += value;
        updateRedisHashField(getKey(), "pricardAdd", this.pricardAdd);
    }

    public long getBuildEarn() {
        return buildEarn;
    }

    public void putBuildEarn(long buildEarn) {
        if (this.buildEarn != buildEarn) {
            this.buildEarn = buildEarn;
            updateRedisHashField(getKey(), "buildEarn", this.buildEarn);
        }
    }

    public void addBuildEarn(long value) {
        this.buildEarn += value;
        updateRedisHashField(getKey(), "buildEarn", this.buildEarn);
    }

    public long getChildEarn() {
        return childEarn;
    }

    public void putChildEarn(long childEarn) {
        if (this.childEarn != childEarn) {
            this.childEarn = childEarn;
            updateRedisHashField(getKey(), "childEarn", this.childEarn);
        }
    }

    public void addChildEarn(long value) {
        this.childEarn += value;
        updateRedisHashField(getKey(), "childEarn", this.childEarn);
    }

    public int getPowerAddTitleCv() {
        return powerAddTitleCv;
    }

    public void putPowerAddTitleCv(int powerAddTitleCv) {
        if (this.powerAddTitleCv != powerAddTitleCv) {
            this.powerAddTitleCv = powerAddTitleCv;
            updateRedisHashField(getKey(), "powerAddTitleCv", this.powerAddTitleCv);
        }
    }

    public void addPowerAddTitleCv(int value) {
        this.powerAddTitleCv += value;
        updateRedisHashField(getKey(), "powerAddTitleCv", this.powerAddTitleCv);
    }

    public int getPowerAddTitlePer() {
        return powerAddTitlePer;
    }

    public void putPowerAddTitlePer(int powerAddTitlePer) {
        if (this.powerAddTitlePer != powerAddTitlePer) {
            this.powerAddTitlePer = powerAddTitlePer;
            updateRedisHashField(getKey(), "powerAddTitlePer", this.powerAddTitlePer);
        }
    }

    public void addPowerAddTitlePer(int value) {
        this.powerAddTitlePer += value;
        updateRedisHashField(getKey(), "powerAddTitlePer", this.powerAddTitlePer);
    }

    public long getPowerAddWorldCv() {
        return powerAddWorldCv;
    }

    public void putPowerAddWorldCv(long powerAddWorldCv) {
        if (this.powerAddWorldCv != powerAddWorldCv) {
            this.powerAddWorldCv = powerAddWorldCv;
            updateRedisHashField(getKey(), "powerAddWorldCv", this.powerAddWorldCv);
        }
    }

    public void addPowerAddWorldCv(long value) {
        this.powerAddWorldCv += value;
        updateRedisHashField(getKey(), "powerAddWorldCv", this.powerAddWorldCv);
    }

    public JsonArray getPowerAddUnionPerArray() {
        if (this.powerAddUnionPer != null && this.powerAddUnionPer.length() > 0) {
            return new JsonArray(this.powerAddUnionPer);
        } else {
            return new JsonArray();
        }
    }

    public String getPowerAddUnionPer() {
        return powerAddUnionPer;
    }

    public void putPowerAddUnionPer(String powerAddUnionPer) {
        if (!this.powerAddUnionPer.equals(powerAddUnionPer)) {
            this.powerAddUnionPer = powerAddUnionPer;
            updateRedisHashField(getKey(), "powerAddUnionPer", this.powerAddUnionPer);
        }
    }

    public JsonArray getEarnAddSecrPerArray() {
        if (this.earnAddSecrPer != null && this.earnAddSecrPer.length() > 0) {
            return new JsonArray(this.earnAddSecrPer);
        } else {
            return new JsonArray();
        }
    }

    public String getEarnAddSecrPer() {
        return earnAddSecrPer;
    }

    public void putEarnAddSecrPer(String earnAddSecrPer) {
        if (!this.earnAddSecrPer.equals(earnAddSecrPer)) {
            this.earnAddSecrPer = earnAddSecrPer;
            updateRedisHashField(getKey(), "earnAddSecrPer", this.earnAddSecrPer);
        }
    }

    public int getEarnAddBankPer() {
        return earnAddBankPer;
    }

    public void putEarnAddBankPer(int earnAddBankPer) {
        if (this.earnAddBankPer != earnAddBankPer) {
            this.earnAddBankPer = earnAddBankPer;
            updateRedisHashField(getKey(), "earnAddBankPer", this.earnAddBankPer);
        }
    }

    public void addEarnAddBankPer(int value) {
        this.earnAddBankPer += value;
        updateRedisHashField(getKey(), "earnAddBankPer", this.earnAddBankPer);
    }

    public JsonArray getEarnAddDecoratePerArray() {
        if (this.earnAddDecoratePer != null && this.earnAddDecoratePer.length() > 0) {
            return new JsonArray(this.earnAddDecoratePer);
        } else {
            return new JsonArray();
        }
    }

    public String getEarnAddDecoratePer() {
        return earnAddDecoratePer;
    }

    public void putEarnAddDecoratePer(String earnAddDecoratePer) {
        if (!this.earnAddDecoratePer.equals(earnAddDecoratePer)) {
            this.earnAddDecoratePer = earnAddDecoratePer;
            updateRedisHashField(getKey(), "earnAddDecoratePer", this.earnAddDecoratePer);
        }
    }

    public JsonArray getEarnAddUnionPerArray() {
        if (this.earnAddUnionPer != null && this.earnAddUnionPer.length() > 0) {
            return new JsonArray(this.earnAddUnionPer);
        } else {
            return new JsonArray();
        }
    }

    public String getEarnAddUnionPer() {
        return earnAddUnionPer;
    }

    public void putEarnAddUnionPer(String earnAddUnionPer) {
        if (!this.earnAddUnionPer.equals(earnAddUnionPer)) {
            this.earnAddUnionPer = earnAddUnionPer;
            updateRedisHashField(getKey(), "earnAddUnionPer", this.earnAddUnionPer);
        }
    }

    public int getEarnAddCavePer() {
        return earnAddCavePer;
    }

    public void putEarnAddCavePer(int earnAddCavePer) {
        if (this.earnAddCavePer != earnAddCavePer) {
            this.earnAddCavePer = earnAddCavePer;
            updateRedisHashField(getKey(), "earnAddCavePer", this.earnAddCavePer);
        }
    }

    public void addEarnAddCavePer(int value) {
        this.earnAddCavePer += value;
        updateRedisHashField(getKey(), "earnAddCavePer", this.earnAddCavePer);
    }

    public int getEarnAddMonsterPer() {
        return earnAddMonsterPer;
    }

    public void putEarnAddMonsterPer(int earnAddMonsterPer) {
        if (this.earnAddMonsterPer != earnAddMonsterPer) {
            this.earnAddMonsterPer = earnAddMonsterPer;
            updateRedisHashField(getKey(), "earnAddMonsterPer", this.earnAddMonsterPer);
        }
    }

    public void addEarnAddMonsterPer(int value) {
        this.earnAddMonsterPer += value;
        updateRedisHashField(getKey(), "earnAddMonsterPer", this.earnAddMonsterPer);
    }

    public int getEarnAddTitlePer() {
        return earnAddTitlePer;
    }

    public void putEarnAddTitlePer(int earnAddTitlePer) {
        if (this.earnAddTitlePer != earnAddTitlePer) {
            this.earnAddTitlePer = earnAddTitlePer;
            updateRedisHashField(getKey(), "earnAddTitlePer", this.earnAddTitlePer);
        }
    }

    public void addEarnAddTitlePer(int value) {
        this.earnAddTitlePer += value;
        updateRedisHashField(getKey(), "earnAddTitlePer", this.earnAddTitlePer);
    }

    public int getWeaponLevelMaxAdd() {
        return weaponLevelMaxAdd;
    }

    public void putWeaponLevelMaxAdd(int weaponLevelMaxAdd) {
        if (this.weaponLevelMaxAdd != weaponLevelMaxAdd) {
            this.weaponLevelMaxAdd = weaponLevelMaxAdd;
            updateRedisHashField(getKey(), "weaponLevelMaxAdd", this.weaponLevelMaxAdd);
        }
    }

    public void addWeaponLevelMaxAdd(int value) {
        this.weaponLevelMaxAdd += value;
        updateRedisHashField(getKey(), "weaponLevelMaxAdd", this.weaponLevelMaxAdd);
    }

    public JsonArray getPartnerIdArray() {
        if (this.partnerId != null && this.partnerId.length() > 0) {
            return new JsonArray(this.partnerId);
        } else {
            return new JsonArray();
        }
    }

    public String getPartnerId() {
        return partnerId;
    }

    public void putPartnerId(String partnerId) {
        if (!this.partnerId.equals(partnerId)) {
            this.partnerId = partnerId;
            updateRedisHashField(getKey(), "partnerId", this.partnerId);
        }
    }

    public JsonArray getBuildIdArray() {
        if (this.buildId != null && this.buildId.length() > 0) {
            return new JsonArray(this.buildId);
        } else {
            return new JsonArray();
        }
    }

    public String getBuildId() {
        return buildId;
    }

    public void putBuildId(String buildId) {
        if (!this.buildId.equals(buildId)) {
            this.buildId = buildId;
            updateRedisHashField(getKey(), "buildId", this.buildId);
        }
    }

    public JsonArray getEarnAddFoodPerArray() {
        if (this.earnAddFoodPer != null && this.earnAddFoodPer.length() > 0) {
            return new JsonArray(this.earnAddFoodPer);
        } else {
            return new JsonArray();
        }
    }

    public String getEarnAddFoodPer() {
        return earnAddFoodPer;
    }

    public void putEarnAddFoodPer(String earnAddFoodPer) {
        if (!this.earnAddFoodPer.equals(earnAddFoodPer)) {
            this.earnAddFoodPer = earnAddFoodPer;
            updateRedisHashField(getKey(), "earnAddFoodPer", this.earnAddFoodPer);
        }
    }

    public JsonArray getPowerAddHaloPerArray() {
        if (this.powerAddHaloPer != null && this.powerAddHaloPer.length() > 0) {
            return new JsonArray(this.powerAddHaloPer);
        } else {
            return new JsonArray();
        }
    }

    public String getPowerAddHaloPer() {
        return powerAddHaloPer;
    }

    public void putPowerAddHaloPer(String powerAddHaloPer) {
        if (!this.powerAddHaloPer.equals(powerAddHaloPer)) {
            this.powerAddHaloPer = powerAddHaloPer;
            updateRedisHashField(getKey(), "powerAddHaloPer", this.powerAddHaloPer);
        }
    }


    public JsonArray getPowerAddUnionCvArray() {
        if (this.powerAddUnionCv != null && this.powerAddUnionCv.length() > 0) {
            return new JsonArray(this.powerAddUnionCv);
        } else {
            return new JsonArray();
        }
    }

    public String getPowerAddUnionCv() {
        return powerAddUnionCv;
    }

    public void putPowerAddUnionCv(String powerAddUnionCv) {
        if (!this.powerAddUnionCv.equals(powerAddUnionCv)) {
            this.powerAddUnionCv = powerAddUnionCv;
            updateRedisHashField(getKey(), "powerAddUnionCv", this.powerAddUnionCv);
        }
    }


}